D - the data type of the data attached to the edge object.public class Edge<D>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private D |
data
The data attached to the edge.
|
private Node |
destination
The node representing the destination.
|
private Node |
source
The node representing the source.
|
private boolean |
undirected
Indicates if this edge should be treated as being undirected.
|
| Constructor and Description |
|---|
Edge(Node source,
Node destination,
D data,
boolean undirected)
Initializes the Edge object.
|
| Modifier and Type | Method and Description |
|---|---|
Edge |
duplicate(Node source,
Node destination)
Attempts to duplicate an Edge based on the supplied parameters.
|
boolean |
equals(java.lang.Object o) |
D |
getData()
Access method for the Edge's data (such as weight).
|
Node |
getDestination()
Access method for the Edge's destination.
|
Node |
getSource()
Access method for the Edge's source.
|
int |
hashCode() |
boolean |
isUndirected()
Access method for the Edge's undirectedness parameter.
|
void |
setData(D data)
Access method for the Edge's data (such as weight).
|
void |
setUndirected(boolean undirected)
Access method for the Edge's undirectedness parameter.
|
java.lang.String |
toString() |
private final Node source
private final Node destination
private D data
private boolean undirected
public Edge(Node source, Node destination, D data, boolean undirected)
source - the Node representing the interaction source.destination - t111111111111111he Node representing the interaction destination.data - the Object representing the Edge data.undirected - the boolean indicating if this edge is undirected.public Node getSource()
public Node getDestination()
public D getData()
public void setData(D data)
data - the new data for the edge.public boolean isUndirected()
public void setUndirected(boolean undirected)
undirected - a boolean indicating if this edge should be undirected.public Edge duplicate(Node source, Node destination)
source - the new Source node reference to utilize.destination - the new Destination node reference to utilize.public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object